package com.itdfq.loginuser.utils;

import com.itdfq.loginuser.domain.DfqUsers;

/**
 * @Author: QianMo
 * @Date: 2021/9/14 14:30
 * @Description: 存储登录之后的用户信息
 */
public class ThreadLocalUserUtils {

    private ThreadLocalUserUtils(){
    }

    private static final ThreadLocal<DfqUsers> LOCAL = new ThreadLocal<DfqUsers>();

    public static void set(DfqUsers user){
        LOCAL.set(user);
    }

    public static DfqUsers get(){
        return LOCAL.get();
    }

    public static void remove(){
        LOCAL.remove();
    }

}
